package pojo;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Conversation {
    private Integer id;
    private Integer userId;
    private String doctorId;
    private String userContent;
    private String doctorContent;
    private Date chatTime;

    // Getters and Setters
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getDoctorId() {
        return doctorId;
    }

    public void setDoctorId(String doctorId) {
        this.doctorId = doctorId;
    }

    public String getUserContent() {
        return userContent;
    }

    public void setUserContent(String userContent) {
        this.userContent = userContent;
    }

    public String getDoctorContent() {
        return doctorContent;
    }

    public void setDoctorContent(String doctorContent) {
        this.doctorContent = doctorContent;
    }

    public Date getChatTime() {
        return chatTime;
    }

    public void setChatTime(Date chatTime) {
        this.chatTime = chatTime;
    }

    @Override
    public String toString() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String formattedTime = chatTime != null ? sdf.format(chatTime) : "null";

        return "Conversation{" +
                "id=" + id +
                ", userId=" + userId +
                ", doctorId='" + doctorId + '\'' +
                ", userContent='" + userContent + '\'' +
                ", doctorContent='" + doctorContent + '\'' +
                ", chatTime=" + formattedTime +
                '}';
    }
}